package com.huangjue.backend.mapper;

import com.huangjue.backend.entity.Demo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface DemoMapper {
    List<Demo> selectDemosByCourseId(@Param("courseId") Integer courseId);

    int getDemosNum(Integer courseId);

    /**
     * 根据demoId获取courseId
     */
    Integer getCourseIdByDemoId(@Param("demoId") Integer demoId);
    Integer updateOpenNum (@Param("demoNum") Integer demoNum,@Param("userId") Integer userId,@Param("courseId") Integer courseId);

    /**
     * 更新课程完成状态
     */
    int updateCourseFinished(@Param("userId") Integer userId, @Param("courseId") Integer courseId);
}